#include "StdAfx.h"
#include ".\webtools.h"

WebTools::WebTools(void)
{
}

WebTools::~WebTools(void)
{
}

void WebTools::getAddress(const CStringArray& nameVec,CStringArray& addrVec)
{
	WORD wVersionRequested;
	WSADATA wsaData;
	int err;

	wVersionRequested = MAKEWORD( 2, 2 );

	err = WSAStartup( wVersionRequested, &wsaData );
	if ( err != 0 ) {
		return;
	}

	
	for(int i=0;i<nameVec.GetSize();i++) 
	{
		USES_CONVERSION;

		struct hostent *h;
		h=gethostbyname(W2A(nameVec[i]));

		if(h != NULL)
		{
//			CString str = inet_ntoa (*(struct in_addr *)*h->h_addr_list);
//			addrVec.Add(str);
		}
	}

	
	WSACleanup( );
}